/**
 * @author LiuYan
 * @date 2021/11/11 17:32
 */
public class Part01 {

    public static void main(String[] args) {
        // 创建字符串
        String str = "hello";
        String helloStr = new String("hello");

        // 字符数组构建字符串
        char[] chars = {'a', 'b', 'c'};
        String str1 = new String(chars);

        // 字节数组构建字符串
        byte[] bytes = {100, 99, 98};
        String str2 = new String(bytes);
        // 将截取的字符数组转换为字符串
        String str3=new String(bytes,0,2);
        System.out.println(str3);

        // char 可以和整数类型相互转换

        byte b = 10;
        short s = 10;
        int i = 10;
        long l = 10;
        char c;
        c = (char) b;
        c = (char) s;
        c = (char) i;
        c = (char) l;
        l=c;














    }


}
